#{extends 'adminm/frame.html' /}

#{set 'moreScripts'}
<script src="@{'/public/javascripts/jquery-ui-1.8.10.custom.min.js'}" type="text/javascript" charset="utf-8"></script>
<script src="@{'/public/pager/jquery.pager.js'}" type="text/javascript" charset="utf-8"></script>
#{/set}
#{set 'moreStyles'}
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/table.scss'}" />
#{/set}
#{set 'activeItem'}0#{/set}

<div class="navigationBar">
	<table>
		<tr>
			<td><img src="@{'/public/images/navigationHouse.gif'}"></td>
			<td><strong>当前位置：</strong></td>
			<td>
				<a href="/admin">首页</a>
				>>
				<a href="#">管理员管理</a>
				>>
				<a href="/admin/administrators">管理员列表</a>
				>>
				<font class="current">修改管理员</font>
			</td>
		</tr>
	</table>
</div>
<script language="javascript">
function doSubmit() {
	$("#form1").submit();
}
function reset() {
	window.location.href="/admin/administrators/${admin.id};edit";
}
</script>
<div id="errMsg" class="error">
	#{error 'errMsg'/}
</div>
<table class="table_edit">
	<thead>
		<tr>
			<th colspan="2">新建管理员</th>
		</tr>
	</thead>
	<tbody>
		#{form @admin.Administrators.update(), name:'form1', id:'form1'}
		<tr>
			<td class="left" width="40%">ID：</td>
			<td>
				<input type="text" maxlength="30" disabled value="${admin.id}">
				<input type="hidden" name='admin.id' maxlength="30" value="${admin.id}">
				<font class="require">*</font>&nbsp;
				<span class="error">#{error 'admin.id' /}</span>
			</td>
		</tr>
		<tr>
			<td class="left" width="40%">账号：</td>
			<td>
				<input type="text" maxlength="30" disabled value="${admin.username}">
				<input type="hidden" name='admin.username' maxlength="30" value="${admin.username}">
				<font class="require">*</font>&nbsp;
				<span class="error">#{error 'admin.username' /}</span>
			</td>
		</tr>
		<tr>
			<td class="left" width="40%">真名：</td>
			<td>
				<input type="text" name='admin.realname' maxlength="30" value="${admin.realname}">
				<font class="require">*</font>&nbsp;
				<span class="error">#{error 'admin.realname' /}</span>
			</td>
		</tr>
		<tr>
			<td class="left" width="40%">密码：</td>
			<td>
				<input type="text" name='admin.password' maxlength="30" value="${admin.password}">
				<font class="require">*</font>&nbsp;
				<span class="error">#{error 'admin.password' /}</span>
				<br>
				(长度为8~20)
			</td>
		</tr>
		<tr>
			<td class="left" width="40%">所属组：</td>
			<td>
				<select name="admin.role.id" >
					#{if roles}
					#{list items:roles, as:'role'}
					<option value="${role.id}" #{if admin.role && admin.role.id==role.id}selected#{/if}>${role.name}</option>
					#{/list}
					#{/if}
				</select>
				<font class="require">*</font>&nbsp;
				<span class="error">#{error 'admin.role' /}</span>
			</td>
		</tr>
		#{/form}
	</tbody>
</table>
<br>
<center>
	<input type="button" value="保存" onClick="doSubmit()">&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="button" value="重置" onClick="reset()">
</center>